package com.mall.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.dubbo.mapper.PmsProductLadderMapper;
import com.mall.model.domain.PmsProductLadder;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author xyiaao
 * @description 针对表【pms_product_ladder(产品阶梯价格表(只针对同商品))】的数据库操作Api实现
 * @createDate 2022-03-29 19:46:09
 */
@DubboService
public class PmsProductLadderApiImpl extends ServiceImpl<PmsProductLadderMapper, PmsProductLadder>
        implements PmsProductLadderApi {

    @Autowired
    private PmsProductLadderMapper productLadderMapper;

    @Override
    public List<PmsProductLadder> findByProductId(Integer id) {

        LambdaQueryWrapper<PmsProductLadder> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(PmsProductLadder::getProductId, id);

        List<PmsProductLadder> pmsProductLadders = productLadderMapper.selectList(queryWrapper);
        return pmsProductLadders;
    }

}




